﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:OdcTest.ViewModels"
    xmlns:bh="clr-namespace:Odyssey.Behaviors;assembly=Odyssey"
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    x:Class="OdcTest.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    SupportedOrientations="Portrait" Orientation="Portrait" bh:TiltEffect.IsTiltEnabled="True"
    shell:SystemTray.IsVisible="True">    

   
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
    
    <phone:PhoneApplicationPage.DataContext>
        <vm:MainViewModel/>
    </phone:PhoneApplicationPage.DataContext>
    
    <Custom:Interaction.Behaviors>
        <bh:SwingEffectBehavior Angle="-90"/>
    </Custom:Interaction.Behaviors>

	<Custom:Interaction.Triggers>
		<Custom:EventTrigger EventName="SelectionChanged" SourceName="listBox">
            <bh:SwingEffectAction/>
        </Custom:EventTrigger>
	</Custom:Interaction.Triggers>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" CacheMode="BitmapCache">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <Grid.Projection>
            <PlaneProjection x:Name="projection" CenterOfRotationX="0" RotationY="0"/>
        </Grid.Projection>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="ODYSSEY DEMOS" Style="{StaticResource PhoneTextNormalStyle}"/>
            <!--<TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>-->
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox x:Name="listBox" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid x:Name="grid" Opacity="1" Height="80">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0" Text="{Binding Name}" Style="{StaticResource PhoneTextExtraLargeStyle}" Margin="88,-5,0,0" VerticalAlignment="Top"/>
                            <TextBlock Grid.Row="1" Text="{Binding Details}" Style="{StaticResource PhoneTextSmallStyle}" Margin="88,-10,0,0" VerticalAlignment="Top"/>
                            <Rectangle Grid.RowSpan="2" Fill="{StaticResource PhoneChromeBrush}" Width="72" Height="72" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

        </Grid>
    </Grid>

</phone:PhoneApplicationPage>